package com.lovo.ssc.controller;


import com.lovo.ssc.entity.Shelves;
import com.lovo.ssc.service.IShelvesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lovo
 * @since 2022-07-07
 */
@RestController
@RequestMapping("/shelves")
@Api(tags = "Shelves")
public class ShelvesController {
    @Autowired
    IShelvesService service;

    /**
     * 添加库存商品状态为已上架的商品到上架表
     * @param shelves 商品对象
     */
    @PostMapping("add")
    @ApiOperation(value = "添加商品")
    public void add(Shelves shelves){
        service.save(shelves);
    }
    @PostMapping("update")
    @ApiOperation(value = "根据批次，修改库存销售价")
    public void update(String batch ,float price){
        service.update(batch,price);
    }
}
